//
//  RNServiceDetailViewController.m
//  app
//
//  Created by 王宇宙 on 2017/12/25.
//  Copyright © 2017年 Facebook. All rights reserved.
//

#import "RNYxDetailViewController.h"

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

@interface RNYxDetailViewController ()

@end

@implementation RNYxDetailViewController

- (void)viewDidLoad {
  [super viewDidLoad];
  // Do any additional setup after loading the view.
  self.title = @"游侠信息";
  [self initRNView];
}

//- (void)viewWillAppear:(BOOL)animated {
//  [super viewWillAppear:animated];
//  [self.navigationController setNavigationBarHidden:NO animated:YES];
//}
//- (void)viewWillDisappear:(BOOL)animated {
//  [super viewWillDisappear:animated];
//  [self.navigationController setNavigationBarHidden:YES animated:YES];
//}
- (void)didReceiveMemoryWarning {
  [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
}


#pragma MARK
- (void)initRNView {
  
  NSURL *jsCodeLocation;
#ifdef DEBUG
  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
  
  NSDictionary *properties = @{@"yxId": _yxId};
  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"YxDetail"
                                               initialProperties:properties
                                                   launchOptions:nil];
  
  rootView.frame = self.view.bounds;
  [self.view addSubview:rootView];
  
}
/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end

